// import complex_query from "@dfeidao/atom-nodejs/db/complex-query"s;
import query from '@dfeidao/atom-nodejs/db/query';
// import log from '@dfeidao/atom-nodejs/logger/log';
import { IncomingHttpHeaders } from 'http';
import { productid, systemid } from '../../atom/config';

interface Message {

}

interface IWebResult {
	data: unknown;
	cookie?: {
		[name: string]: string;
	} | null;
	content_type?: string;
	headers?: {
		[key: string]: string;
	};
	attachment?: string;
	redirect?: string;
	status_code?: number;
}

export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders): Promise<IWebResult> {
	// log('Service begin path:c:\Users\32645\Desktop\kh\src\plan-cb\zj-000002\s001,action_id:' + action_id);

	// log('Service end path:c:\Users\32645\Desktop\kh\src\plan-cb\zj-000002\s001,action_id:' + action_id);

	const q = query(action_id, session_id, systemid);
	q.prepare('plan_classify', ['plan_cla_attr_no', 'plan_cla_attr_name'], { productid }, 200, 1, [], []);
	const [res] = await q.exec();


	return {
		data: { res }
	};
}
